﻿package cn.edu.zjusc.Webservice;
import java.util.List;

import javax.ejb.Stateless;
import javax.jws.*;
import javax.jws.soap.SOAPBinding;
import javax.persistence.*;



import org.jboss.wsf.spi.annotation.WebContext;

import cn.edu.zjusc.POJO.*;
@Stateless
@WebService( name = "RaceCodeService", serviceName = "RaceCodeService")   
@SOAPBinding(style = SOAPBinding.Style.RPC)
@WebContext (contextRoot="/ZJUSCIX/Service", urlPattern="/RaceCodeService") 
public class RaceCodeService {
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public List<RaceCode> GetAllRaceCodeInfo() {

		EntityManagerFactory emf =Persistence.createEntityManagerFactory("zjusc");
		EntityManager em=emf.createEntityManager();

		Query query=em.createQuery("from RaceCode e");
		List cdList=query.getResultList();
		
		em.close();
		emf.close();
		return cdList;
	}
}
